//
//  PYResult.h
//  Piaoyoung
//
//  Created by LiTengFei on 15/6/2.
//  Copyright (c) 2015年 HangZhou PiaoYoung Co.Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PYError.h"

@class PYResult;

typedef PYResult *(^AnalyseBlock)(NSDictionary *dictionary);

@interface PYResult : NSObject

@property(nonatomic, assign) NSInteger codeStyle;
@property(nonatomic, strong) NSString *message;

@property(nonatomic, strong) NSMutableArray *dataArray;
@property(nonatomic, strong) id <NSObject> object;
@property(nonatomic, strong) NSString *data;

@property(nonatomic, strong) PYError *error;
@property(nonatomic, copy) AnalyseBlock analyseBlock;

- (instancetype)initWithDictionary:(NSDictionary *)dictionary NS_DESIGNATED_INITIALIZER;

+ (instancetype)resultWithDictionary:(NSDictionary *)dictionary;

//- (instancetype)initWithDictionary:(NSDictionary *)dictionary
//                      analyseBlock:(AnalyseBlock)analyse;

//+ (instancetype)resultWithDictionary:(NSDictionary *)dictionary analyseBlock:(AnalyseBlock)analyse;

- (void)anasyleData:(NSDictionary *)dictionary;

@end
